package com.qf.hospital.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.hospital.entity.OutPatientType;
import com.qf.hospital.mapper.OutPatientTypeMapper;
import com.qf.hospital.service.OutPatientTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 何星宇
 * @version V1.0
 * @Date 2021/10/22 11:08
 */

@Service
public class OutPatientTypeServiceImpl implements OutPatientTypeService {
    @Autowired
    private OutPatientTypeMapper mapper;

    /**
     * 查询项目信息
     * @param projectName
     * @param page
     * @param limit
     * @return
     */
    @Override
    public PageInfo<OutPatientType> findByProjectNameAndPage(String projectName, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<OutPatientType> outPatientTypeList = mapper.findByProjectName(projectName);
        PageInfo<OutPatientType> pageInfo = new PageInfo<>(outPatientTypeList);
        return pageInfo;
    }
}
